package server.workwithorder;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import abstractservlet.AbstractServlet;
import autoservice.api.controller.IAutoservice;
import controllers.Autoservice;

@WebServlet("/GetOrderByMaster")
public class GetOrderByMaster extends AbstractServlet {
	private static final String MASTER_NAME = "masterName";
	private static final String GET_ORDER_BY_MASTER_PAGE = "/workwithorderpages/GetOrderByMasterPage.jsp";
	private static final String GET_ORDER_BY_MASTER_OPERAT = "get order by master";
	private static final long serialVersionUID = 1L;
	private IAutoservice autoservice = Autoservice.getInstance();

	public GetOrderByMaster() {
		super();

	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String parameters = request.getParameter(MASTER_NAME);
		super.navigate(request, response, GET_ORDER_BY_MASTER_OPERAT,
				autoservice.getOrderByMaster(parameters).get(0),
				GET_ORDER_BY_MASTER_PAGE);

	}

}
